﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace recursion
{
    public class Math
    {
        public int EatApple( int days,ref int n)
        {
            n = n * 2 + 2;
            days--;
            if (days > 0)
            {
                EatApple( days,ref n);
            }
            
             
            return n;
        }
    }
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入天数：");
            int day = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入现在剩余苹果数：");
            int n = int.Parse(Console.ReadLine());
            Math math = new Math();
            n = math.EatApple(day,ref n);
            Console.WriteLine($"原来有{n}个苹果，吃了{day}天。");
            Console.WriteLine("------------------------------");
            if(n / day >= 9)
            Console.WriteLine("你可真能吃啊！");
            Console.WriteLine();
        }
    }
}
